<?php

namespace app\admin\controller;

use app\common\business\SysLogininfor;

class Logout extends AuthBase
{
    public function index(){
        //删除redis token缓存
        $res = cache(config("redis.token_pre").$this->accessToken, NULL);
        if($res){
            $sysLogininfor = new SysLogininfor();
            $sysLogininfor->addLogininfor('退出成功',$this->username);
            return show(config("status.success"),"退出登录成功");
        }
        return show(config("status.error"),"退出登录失败");
    }
}
